{template 'header'}
    <style>
        #top_tab li{
            line-height: 3;
            color: #333;
            background: #fff;
        }
        #top_tab .mui-active{
            color: #007aff;
        }
        #slider h4{
            font-size: 14px;
            font-weight: 300;
        }
        #slider p{
            font-size: 12px;
        }
        #slider h5 span{
            font-size: 14px;
            font-weight: 600;
        }
        .noting{
            line-height: 2;
            text-align: center;
            font-size: 14px !important;
        }
    </style>
</head>
<body>
    <!-- 头部 结束 -->
    <div class="mui-content mui-scroll-wrapper">
        <div class="mui-scroll">
            <!-- tab 列表开始 -->
            <div class="mui-slider" id="slider">
                <div class="mui-slider-indicator mui-segmented-control mui-segmented-control-inverted" id="top_tab">
                    <li class="mui-control-items mui-col-xs-6 mui-inline mui-active">任务佣金</li>
                    <li class="mui-control-items mui-col-xs-6 mui-inline">推广佣金</li>
                </div>
                <div class="mui-slider-progress-bar mui-col-xs-6"></div> <!--选项卡滑动条-->
                <div class="mui-slider-group" id='tab_content'>
                    <div class="mui-slider-item mui-control-content mui-active">
                        <ul class="mui-table-view mui-table-view-striped mui-table-view-condensed data_list">
                            {loop $list1 $item}
                            <li class="mui-table-view-cell">
                                <div class="mui-table">
                                    <div class="mui-table-cell mui-col-xs-10">
                                        <h4>任务ID: {$item['taskid']}</h4>
                                        <h5>金额:<span class="mui-badge-danger mui-badge-inverted">{$item['fxyj']}</span>元</h5>
                                        <p class="time">{$item['create_time']}</p>
                                    </div>
                                </div>
                            </li>
                            {/loop}
                        </ul>
                    </div>
                    <div class="mui-slider-item mui-control-content">
                        <ul class="mui-table-view mui-table-view-striped mui-table-view-condensed data_list">
                            {loop $list2 $item}
                            <li class="mui-table-view-cell">
                                <div class="mui-table">
                                    <div class="mui-table-cell mui-col-xs-10">
                                        <h4>用户ID: {$item['sup_id']} </h4>
                                        <h5>金额:<span class="mui-badge-danger mui-badge-inverted">{$item['fxyj']}</span>元</h5>
                                        <p class="time">{$item['create_time']}</p>
                                    </div>
                                </div>
                            </li>
                            {/loop}
                        </ul>
                    </div>
                </div>
            </div>
            <!-- tab 列表结束 -->
        </div>
    </div>
    <script src="{MODULE_URL}assets/js/jquery.min.js"></script>
    <script src="{MODULE_URL}assets/js/mui.min.js"></script>
    <script src="{MODULE_URL}assets/js/template-web.js"></script>
    <script>
        //实现鼠标点击切换效果
        $('#top_tab li').click(function(){
            var gallery = mui('#slider');
            $('#top_tab li').removeClass('mui-active');
            $(this).addClass('mui-active');
            gallery.slider().gotoItem($(this).index())
        });
        // 动态添加 top_tab 的 active
        document.querySelector('#slider').addEventListener('slide', function(event) {
            var index = event.detail.slideNumber;
            $('#top_tab li').removeClass('mui-active');
            $('#top_tab li').eq(index).addClass('mui-active')
        });

        for(let i = 0; i < $('.data_list').length ; i++){
            if($('.data_list').eq(i).children('li').length == 0){
                $('.data_list').eq(i).parent().css('border','none');
                $('.data_list').eq(i).after('<p class="noting">暂无数据</p>')
            }
        }
    </script>
</body>
</html>